﻿using System;
using System.Reflection;

namespace Xms.Abp.Data;

public class ConnectionUrlNameAttribute : Attribute
{
    public string Name { get; }
    public ConnectionUrlNameAttribute(string name)
    {
        Name = name;
    }

    public static string GetConnUrlName<T>()
    {
        return GetConnUrlName(typeof(T));
    }

    public static string GetConnUrlName(Type type)
    {
        return type.GetCustomAttribute<ConnectionUrlNameAttribute>()?.Name;
    }
}

